<?php


namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Notifications\Notifiable;
use Watson\Validating\ValidatingTrait;

class StudentGroup extends Model
{
    use Notifiable;
//    use SoftDeletes;
    use ValidatingTrait;
    protected $table = "student_groups";
    protected $fillable = [
        "class_group_id",
        "student_id",
        "deleted_at"
    ];
    public function classes(){
        return $this->hasOne('App\Models\ClassGroup','id','class_group_id');

    }
    public function user(){
        return $this->hasOne('App\Models\ElectiveStudent','id','student_id');

    }
    protected $rules = [
//        'open_id' => 'required|unique:wechat_users'
    ];
    protected $validationMessages = [
//        'open_id.required' => '用户名必填',
//        'open_id.unique' => '该id已经被注册过了',
    ];
}
